<template>
  <div>
    <xw-loadingcmp v-if="!info" />
    <div v-else>
      <div class="detail">
        <div class="img">
          <img v-lazy="info.poster" />
        </div>
        <div class="item">
          <div>{{ info.name }}</div>
          <div>剧情 | 喜剧</div>
          <div>{{ info.premiereAt | formatDate }}上映</div>
          <div>中国大陆 | 0 分钟</div>
          <div>{{ info.synopsis }}</div>
        </div>
      </div>
      <!-- 演员 -->
      <div class="actors">
        <div class="actors-title">演职人员</div>
        <div class="actors-list">
          <ul>
            <li v-for="(item, index) of 6" :key="index">
              <div>
                <img src="https://pic.maizuo.com/usr/movie/b0b7ee851580bce62c00985cf1a1c061.jpg?x-oss-process=image/quality,Q_70" alt="" />
                <div>雨果·热兰</div>
              </div>
            </li>
          </ul>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { getFilmInfo } from '@/api/filmApi'
export default {
  props: ['id'],
  data() {
    return {
      info: null
    }
  },
  async mounted() {
    // console.log(this.id)
    // let ret = await getFilmInfo(this.$route.params.id)
    let ret = await getFilmInfo(this.id)
    this.info = ret.data.film
  }
}
</script>

<style lang="scss" scoped>
.detail {
  .img {
    width: 100%;
    height: 56vw;
    overflow: hidden;
    background: #fff;
    img {
      width: 100%;
    }
  }
  .item {
    padding: 15px;
    padding-top: 12px;
    background: #fff;
    color: #797d82;
    font-size: 13px;
    div:nth-of-type(1) {
      font-size: 18px;
      color: #191a1b;
    }
    div:nth-of-type(5) {
      height: 35px;
      overflow: hidden;
    }
  }
}
.actors {
  margin-top: 10px;
  background-color: #fff;
  .actors-title {
    font-size: 16px;
    text-align: left;
    color: #191a1b;
    padding: 15px;
  }
  .actors-list {
    width: 100vw;
    overflow: hidden;
    height: 120px;
    > ul {
      height: 140px;
      display: flex;
      overflow-y: hidden;
      overflow-x: scroll;
      li {
        margin-right: 10px;
        div {
          width: 85px;
          height: 85px;
          img {
            width: 100%;
            height: 100%;
          }
          div {
            font-size: 12px;
            color: #191a1b;
          }
        }
      }
    }
  }
}
</style>
